package com.zigong.app.beans;

import android.support.annotation.NonNull;

import com.ruihang.generalibrary.ui.util.IListData;
import com.zigong.app.ui.datainf.IAdvanceData;

import java.io.Serializable;
import java.util.List;

/**
 * Created by Administrator on 2017/8/14 0014.
 */

public class FCityState implements IAdvanceData, Serializable, Comparable<FCityState> {
    private static final long serialVersionUID = 3508697030668433311L;
    private String cityName;
    private String hot;
    private String hotLevel;
    private String institutionId;
    private String institutionImage;
    private String institutionName;
    private boolean isSubscibe;//是否已订阅
    private String institutionUrl;
    private int type; // 1代表订阅 0代表未订阅
    private List<FCountyState> countyStateList;

    public String getCityName() {
        return cityName;
    }

    public void setCityName(String cityName) {
        this.cityName = cityName;
    }

    @Override
    public String getDataTitle() {
        return institutionName;
    }

    @Override
    public String getDataImg() {
        return institutionImage;
    }

    @Override
    public String getDataTag() {
        return hotLevel;
    }

    @Override
    public String getDataId() {
        return institutionId;
    }

    @Override
    public int getDataType() {
        return 0;
    }

    @Override
    public int getDataViewType() {
        return 0;
    }

    @Override
    public IListData getOwner() {
        return null;
    }

    @Override
    public boolean isSubscribe() {
        return isSubscibe;
    }

    @Override
    public String getTime() {
        return null;
    }

    public String getHotLevel() {
        return hotLevel;
    }

    public FCityState setHotLevel(String hotLevel) {
        this.hotLevel = hotLevel;
        return this;
    }

    public String getInstitutionId() {
        return institutionId;
    }

    public FCityState setInstitutionId(String institutionId) {
        this.institutionId = institutionId;
        return this;
    }

    public String getInstitutionImage() {
        return institutionImage;
    }

    public FCityState setInstitutionImage(String institutionImage) {
        this.institutionImage = institutionImage;
        return this;
    }

    public String getInstitutionName() {
        return institutionName;
    }

    public FCityState setInstitutionName(String institutionName) {
        this.institutionName = institutionName;
        return this;
    }

    public boolean isSubscibe() {
        return isSubscibe;
    }

    public FCityState setSubscibe(boolean subscibe) {
        isSubscibe = subscibe;
        return this;
    }

    public String getInstitutionUrl() {
        return institutionUrl;
    }

    public FCityState setInstitutionUrl(String institutionUrl) {
        this.institutionUrl = institutionUrl;
        return this;
    }

    public String getHot() {
        return hot;
    }

    public FCityState setHot(String hot) {
        this.hot = hot;
        return this;
    }

    public int getType() {
        return type;
    }

    public FCityState setType(int type) {
        this.type = type;
        return this;
    }

    public List<FCountyState> getCountyStateList() {
        return countyStateList;
    }

    public void setCountyStateList(List<FCountyState> countyStateList) {
        this.countyStateList = countyStateList;
    }

    @Override
    public String toString() {
        return "FCityState{" +
                "hot='" + hot + '\'' +
                ", hotLevel='" + hotLevel + '\'' +
                ", institutionId='" + institutionId + '\'' +
                ", institutionImage='" + institutionImage + '\'' +
                ", institutionName='" + institutionName + '\'' +
                ", isSubscibe=" + isSubscibe +
                ", institutionUrl='" + institutionUrl + '\'' +
                ", type=" + type +
                '}';
    }

    @Override
    public int compareTo(@NonNull FCityState city) {
        int i = city.getType() - this.getType();
        if (i == 0) {
            int i1 = Integer.parseInt(city.getHot());
            int i2 = Integer.parseInt(this.getHot());
            return i1 - i2;
        }
        return i;
    }
}
